package sample.api;

import org.dreamwork.jasmine2.restful.AbstractRestfulAPI;
import org.dreamwork.jasmine2.restful.RestfulAPIErrorMessage;
import org.dreamwork.jasmine2.restful.RestfulAPIException;
import sample.data.Gender;
import sample.data.Person;

import java.util.Date;

/**
 * Created with IntelliJ IDEA.
 * User: seth.yang
 * Date: 14-11-18
 * Time: 下午2:47
 */
public class UserAPI extends AbstractRestfulAPI {
    public Object get (Object parameter) throws RestfulAPIException {
        return RestfulAPIErrorMessage.OK;
    }

    public Object post (Object parameter) throws RestfulAPIException {
        Person person = new Person ();
        person.setAge (32);
        person.setGender (Gender.Male);
        person.setName ("Test Person");

        return person;
    }

    public Date today (int id) {
        return new Date ();
    }

}
